<?php namespace Member\Controller; 

use Hdphp\Controller\Controller;
use Member\Model\Msg;

class MsgController extends Controller
{
	protected $db;

	//构造函数
	public function __init()
	{
		$this->db = new Msg;
	}
	
    //动作
    public function msg(){
    	if(IS_POST){    		
    		$data['id'] = $_POST['id'];
    		$data['nickname'] = $_POST['nickname'];
    		$data['name'] = $_POST['name'];
    		$data['sex'] =  $_POST['sex'];
    		$data['birthday'] = $_POST['y'].$_POST['m'].$_POST['d'];
    		$data['address'] = $_POST['sheng'].$_POST['shi'].$_POST['qu'].$_POST['addr'];
    		$data['postcode'] = $_POST['postcode'];
    		$data['phone'] = $_POST['phone'];
    		$data['fixedphone'] = $_POST['fixedphone'];
    		if($this->db->edit($data))
    		{
    			View::success('资料保存成功');
    		}
    	}else{
    		View::make();
    	}
       
    }
}
